package com.github.aloxc.plugin.restplus.component;

import com.github.aloxc.plugin.restplus.common.Consts;
import com.intellij.execution.Executor;
import com.intellij.execution.ExecutorRegistry;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;

public class RunExecutor extends Executor {
    public static final String TOOLWINDOWS_ID = Consts.PLUGIN_ID + " Log";

    @Override
    @NotNull
    public String getStartActionText() {
        return TOOLWINDOWS_ID;
    }

    @Override
    public String getToolWindowId() {
        return TOOLWINDOWS_ID;
    }

    @Override
    public Icon getToolWindowIcon() {
        return Consts.Icons.SERVICE;
    }

    @Override
    @NotNull
    public Icon getIcon() {
        return Consts.Icons.SERVICE;
    }

    @Override
    public Icon getDisabledIcon() {
        return Consts.Icons.SERVICE;
    }

    @Override
    public String getDescription() {
        return null;
    }

    @Override
    @NotNull
    public String getActionName() {
        return TOOLWINDOWS_ID;
    }

    @Override
    @NotNull
    public String getId() {
        return Consts.PLUGIN_ID;
    }

    @Override
    public String getContextActionId() {
        return "RestPlusLogActionId";
    }

    @Override
    public String getHelpId() {
        return null;
    }

    public static Executor getRunExecutorInstance() {
        return ExecutorRegistry.getInstance().getExecutorById(Consts.PLUGIN_ID);
    }
}
